package com.ruoyi.cms.controller.portal;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.oss.RAMGenerateSignature;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 微信小程序
 */
@RestController
@Slf4j
@RequestMapping("/portal/cms/miniProgram")
public class MiniProgramController {

    /**
     * 获取阿里云临时访问凭证
     *
     * @return
     * @throws JsonProcessingException
     */
    @GetMapping("/generateSignature")
    public R<Map<String, String>> generate_signature() throws JsonProcessingException {
        RAMGenerateSignature ramGenerateSignature = new RAMGenerateSignature();
        return R.ok(ramGenerateSignature.getSignature());
    }


}
